{% set title = "Admin: Listar Filmes" %}
{% extends 'layouts/layout_admin.html' %}

<link rel="stylesheet" href="/css/dataTables.bootstrap.min.css">

<style media="screen">
.text-small{
  font-size: 10px !important;
}
</style>

{% block body %}


<div class="container-fluid">
  <table class="table  table-striped table-bordered text-small"  style="width:100%" id="example">
    <thead>
      <tr>
        <th>id</th>
        <th>Titulo</th>
        <th>Duração</th>
        <th>Criador</th>
        <th>permalink</th>
        <th>Img Cover</th>
        <th>Img Bg</th>
        <th>Situação</th>
        <th>URL Video</th>
        <th>Status</th>
        <th>Ação</th>
      </tr>
    </thead>
    <tbody>
      {% for w in watch %}
      <tr>
        <td>{{ w.id | truncate(5)}} </td>
        <td> <a href="/i/{{ w.permalink }}">{{ w.title | truncate(50) }}</a> </td>
        <td> {{ w.duration }} </td>
        <td> <textarea rows="1" cols="10" style="font-size: 10px;">{{ w.criador.email }}</textarea> </td>
        <td> <textarea rows="1" cols="10" style="font-size: 10px;">{{ w.permalink }}</textarea></td>
        <td> <a href="{{ w.thumb480 }}" target="_blank"><img src="{{ w.thumb480 }}" width="100" alt="" loading="lazy"> </a></td>
        <td> <a href="{{ w.imgbg }}" target="_blank"><img src="{{ w.imgbg }}" width="100" alt="" loading="lazy"></a>  </td>
        <td>
          {% if w.featured == 'true' %}
            Publicado
          {% else %}
            Aguardando
          {% endif %}
        </td>
        <td><textarea rows="1" cols="10" style="font-size: 10px;">{{ w.video }}</textarea></td>
        <td>{{w.status}}</td>
        <td>
            <a href="/edit/{{ w._id }}" target="_blank">Editar</a>
        </td>
      </tr>
      {% endfor %}
    </tbody>
  </table>
</div>


{% endblock %}
